﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model.EF;
using Model;

public partial class themes : System.Web.UI.Page
{
    protected int rptCount = 0;
    protected void Page_Load(object sender, EventArgs e)
    {
        IRepository<wallpaper> wallpaperRepository = new EntityRepository<wallpaper>();

        IList<wallpaper> list = wallpaperRepository.FindAll().ToList();
        rptCount = list.Count;
        rpttheme.DataSource = list;
        rpttheme.DataBind();
        for (int i = 0; i < wallpapertype.Items.Count; i++)
        {
            if (wallpapertype.Items[i].Value == Session["wallpapertype"].ToString())
            {
                wallpapertype.Items[i].Selected = true;
            };
        }
    }

    protected string GetThCss(int x)
    {
        if (x % 3 == 2)
        {
            return "class=\"three\"";
        }
        
        return "";
    }

    protected string getFileInfo(string url)
    {
        string x = url.Substring(url.LastIndexOf('/') + 1);

        string path = url.Substring(0, url.LastIndexOf('/')+1);
        x=path+"s_"+x;
        return x;
    }
}